ci: update push branches in psalm workflow#54
Conversation
WalkthroughGitHub Actions の psalm ワークフローで、push トリガー対象を Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant GH as GitHub (events)
participant WF as psalm.yml (workflow)
participant CH as actions/checkout@08c6903c
participant PHP as shivammathur/setup-php@ec406be51
participant PS as Psalm
note over GH,WF #F3F4F6: トリガー (push on 'gh-pages', pull_request, schedule, workflow_dispatch)
GH->>WF: push (gh-pages) / other triggers
WF->>CH: checkout code (pinned)
WF->>PHP: setup PHP (pinned, tools: composer:v2, coverage: none)
WF->>PS: run psalm
PS-->>WF: result
WF-->>GH: status
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/psalm.yml (1)
25-31: Actions のバージョンをタグではなくコミット SHA でピン留めしてください
supply chainリスク低減のためshivammathur/setup-php@v2やactions/checkout@v4をコミット SHA に固定することを推奨します(Dependabot で定期更新)。
🧹 Nitpick comments (3)
.github/workflows/psalm.yml (3)
30-35: Composer 依存キャッシュで CI を高速化Composer キャッシュを追加すると実行時間短縮とネットワーク安定性に寄与します。
- name: Checkout Repository uses: actions/checkout@v4 + - name: Cache Composer dependencies + uses: actions/cache@v4 + with: + path: ~/.composer/cache/files + key: composer-${{ runner.os }}-${{ hashFiles('composer.lock') }} + restore-keys: | + composer-${{ runner.os }}- + - name: Install Dependencies run: composer install --prefer-dist --no-interaction --no-progress --dev
36-37: GitHub 注釈でレビューしやすく出力PSalm の出力を GitHub フォーマットにし、進捗表示を抑制するとログが見やすくなります。情報レベルのメッセージが多すぎる場合は
--show-info=falseも検討してください。- - name: Run Psalm - run: vendor/bin/psalm --show-info=true + - name: Run Psalm + run: vendor/bin/psalm --output-format=github --no-progress --show-info=true
6-6: gh-pagesブランチにcomposer.jsonとpsalm.xmlが存在psalm.xml.distは見つかりませんでしたが、psalm.xmlがあるためジョブは正常に実行されます。必要に応じてpushトリガーにtags(例:v*)やpathsフィルター(例:**/.php、composer.json、composer.lock、psalm.xml)の追加を検討してください。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
.github/workflows/psalm.yml(1 hunks)
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
.github/workflows/psalm.yml (2)
6-6: gh-pages のみへの push 制限は妥当デフォルトブランチが
gh-pagesで、過去に*.xブランチも存在しませんでした。
要件に応じて、他ブランチ(例:main)への直接 push を含めるか、pathsフィルタで PHP 変更時のみ実行することをご検討ください。
25-25: setup-php アクションの SHA 固定は有効です (ec406be5: 2025-08-25 “Bump version to 2.35.4”)
- PHP 8.4/Ubuntu 24.04 のサポート可否を公式リポジトリで事前確認してください
- 任意:
tools: composer:v2とcoverage: noneを追加するとワークフローが高速化されます- name: Setup PHP ${{ matrix.php-version }} - uses: shivammathur/setup-php@ec406be512d7077f68eed36e63f4d91bc006edc4 + uses: shivammathur/setup-php@ec406be512d7077f68eed36e63f4d91bc006edc4 with: php-version: ${{ matrix.php-version }} extensions: mbstring, xml + tools: composer:v2 + coverage: none
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
.github/workflows/psalm.yml(2 hunks)
🔇 Additional comments (1)
.github/workflows/psalm.yml (1)
31-31: Checkout アクションに persist-credentials: false を追加
push を行わないワークフローのため、トークン漏洩リスクを低減します。- name: Checkout Repository - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 + with: + persist-credentials: false
Psalm 用のワークフローにおいてプッシュのブランチが存在しない *.x になっていたため、デフォルトブランチの gh-pages に変更しました。また、動作に影響しない範囲で微調整を行いました。
Summary by CodeRabbit